<@master template="layout/master">
<script type="text/javascript">
    $(document).ready(function () {
        if ($("#agreeTerm").val() == "false") {
            SuryaniNoCloseBtnHopupHopup(460, null, $('#term'), true, null);
        }
        $("#agreeTermForm").validate({
            messages: {
                agreeTerm: {
                    required: "You must agree to Suryani Terms and Conditions of Use before you gain access to<br>Suryani's Vendor Portal."
                }
            },
            errorPlacement: function (error, element) {
                $("#beforeTerm").hide();
                error.appendTo($("#errorMsg"));
                $("#errorMsg").addClass("errorsContentBox");
            },
            success: function (error, element) {
                $("#beforeTerm").show();
                error.remove();
                $("#errorMsg").removeClass("errorsContentBox");
            }
        });
    });
</script>
<input type="hidden" id="agreeTerm" value="${agreeTerm?string}"/>
<div class="pt10 contentWrap">
    <p class="font16 orangeColor pb10">Welcome to Suryani's Vendor Portal.</p>
    <table style="width:100%;">
        <tr>
            <#if hasDropShipRole?? && hasDropShipRole==true>
                <td class="verticalTop" style="width:680px;">
                    <div class="infoBoxWrap">
                        <p class="infoBoxTitle">Dropship</p>

                        <div class="infoBoxContent">You are configured to be a Suryani Drop Ship Vendor. The Suryani Vendor Portal allows you to control your warehouse
                            configurations. Additionally, you may see reports on how you are performing as a drop ship vendor.
                        </div>
                    </div>
                </td>
            </#if>
            <td class="verticalTop">
                <div class="ml1em pl20">
                    <div class="infoBoxWrap">
                        <p class="infoBoxTitle">Get Help</p>

                        <div class="infoBoxContent">
                            If you need assistance please email <a class="underlineLink orangeColor" href="mailto:vendorportal@suryani.com">vendorportal@suryani.com</a> for all questions.
                        </div>
                    </div>
                </div>
            </td>
        </tr>
    </table>
</div>
<div id="term" class="pt10 displayNone">
    <p class="infoBoxTitle">Suryani Vendor Portal Terms of User</p>

    <div id="beforeTerm" class="mt4">
        Before you are able to gain access to Suryani's Vendor Portal you must agree to Suryani's Terms and Conditions of Use.
    </div>
    <form id="agreeTermForm" action="<@url value='/home/agreeterm'/>" method="POST">
        <div id="errorMsg"></div>
        <p class="mt8"><b>Suryani's Terms and Conditions of Use</b>&nbsp;&nbsp;<a class="underlineLink orangeColor" href="<@url value='/static/pdf/VendorPortalTerms.pdf'/>" target="_blank">View Terms
            and Conditions</a></p>

        <p class="pt10"><b>I verify that I have read and agree to Suryani Terms and Conditions of Use</b>&nbsp;&nbsp;<input type="checkbox" id="agreeTermCheckbox" class="required" name="agreeTerm"/>
        </p>

        <div class="pt10 centeredButton90px"><span class="defaultButtonBox"><input type="button" value="Submit" onclick="submitAgreeTerm()"/></span></div>
    </form>
</div>
<script type="text/javascript">
    function submitAgreeTerm() {
        $("#agreeTermForm").ajaxSubmit({callback: function () {
            $("#term").hide();
            window.parent.SuryaniNoCloseBtnHopupObj.close();
        }});
    }
</script>
</@master>